package com.swy.shopgroup;


import com.swy.shopgroup.entity.Result;

public class ResultUtils {
    public static Result success(String msg, Object o) {
        Result result = new Result();
        result.setCode("200");
        result.setMsg(msg);
        result.setData(o);
        return result;
    }

    public static Result success() {
        Result result = new Result();
        result.setCode("200");
        result.setMsg("请求成功");
        return result;
    }

    public static Result err() {
        Result result = new Result();
        result.setCode("400");
        result.setMsg("请求失败");
        return result;
    }

    public static Result err(String s) {
        Result result = new Result();
        result.setCode("400");
        result.setMsg(s);
        return result;
    }
}
